var status = 0;
var eff1 = "#fUI/UIPVP.img/MiniMapIcon/star#";
var ttt = "#fUI/UIPVP.img/MiniMapIcon/star#";//"+ttt+"//美化1
var eff = "#fUI/UIWindow2.img/AttackRangking/1#";//小皇冠
var ttt = "#fUI/UIPVP.img/MiniMapIcon/star#";//小黄心
var 头顶 ="#fItem/Cash/0501.img/05010002/effect/default/7#";
var tz12 = "#fEffect/CharacterEff/1112924/0/0#";  //黄星
var tz13 = "#fEffect/CharacterEff/1112925/0/0#";  //蓝星
var tz14 = "#fEffect/CharacterEff/1112926/0/0#";  //红星
var 横条 = "#fEffect/SetEff.img/64/backgrnd/20";//雪人
var us = "#fUI/CashShop.img/CSDiscount/bonus#";//小黄心
var ums = "#fUI/UIWindowPL.img/GodOfBrain/npcAni3/stand/0#";//小黄心
var F123 = "#fMob/2400204.img/move/4#";//迷你女皇
var IconA = "#fEffect/CharacterEff/1112903/0/0#"; //红心
var IconB = "#fEffect/CharacterEff/1112904/0/0#"; //彩心
var IconC = "#fEffect/CharacterEff/1112924/0/0#"; //黄星
var IconD = "#fEffect/CharacterEff/1112925/0/0#"; //蓝星
var IconE = "#fEffect/CharacterEff/1112926/0/0#"; //红星
var IconF = "#fUI/RunnerGame.img/RunnerGameUI/UI/Point/2#"
var 账户 = "#fUI/StatusBar3.img/FadeYesNo/icon5#";//"+ttt+"//美化1
var 赞助 = "#fUI/StatusBar3.img/FadeYesNo/icon6#";//"+ttt+"//美化1
var 点卷 = "#fUI/CashShop.img/CashItem/0#";//"+ttt+"//美化1
var 抵用 = "#fUI/CashShop.img/CashItem_label/0#";//"+ttt+"//美化1
var 活跃 = "#fUI/CashShop.img/CashItem_label/2#";//"+ttt+"//美化1
var 积分 = "#fUI/CashShop.img/CashItem_label/3#";//"+ttt+"//美化1
var PK = "#fUI/CashShop.img/CashItem_label/1#";//"+ttt+"//美化1
function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (cm.getMapId() == 180000001 || cm.getMapId() == 910340000) {
            cm.sendOk("很遗憾，您因为在特殊地图无法使用此功能.")
            cm.dispose();
        } else if (status == 0) {
		var selStr = "\r\n#n#r #e您可以进行以下兑换操作：\r\n\r\n";			
		selStr += "#L0#" + ums + " #b#e<点卷兑换> #r条件：#k赞助PPMS币再兑换成PPMS点卷#l\r\n\r\n";	
		selStr += "#L1#" + ums + " #b<兑换椅子> #r免费：#k万花筒宝箱开出的币即可兑换#d#l\r\n\r\n";
		selStr += "#L2#" + ums + " #b<兑换点装> #r福利：#k参加活动获得闪耀币可兑换#l\r\n\r\n";			
		selStr += "#L3#" + ums + " #b<以币换币> #r说明：#kBOSS币能换其他高级BOSS币#l\r\n\r\n";					
        cm.sendSimple(selStr);
    } else if (status == 1) {
        switch (selection) {
        case 0:
			cm.dispose();
			cm.openNpc(1540861,"赞助送礼");	// 余额换点券
            break;
        case 1:
			cm.dispose();
			cm.openNpc(9330111);	// 万花筒币换椅子
            break;
        case 2:
			cm.dispose();
			cm.openNpc(9310644);	// 闪耀币换点装
            break;
        case 3:
			cm.dispose();
			cm.openNpc(9400402,"币类兑换");	// 闪耀币换点装
            break;
		case 4:
			cm.dispose();
            //cm.openWeb("http://www.ddmxdsf.cn/forum.php?mod=viewthread&tid=24&extra=");
            cm.sendOk("#e#r[提示]：\r\n已为您打开各种装备制作冶炼教程~\r\n[注意]：\r\n部分帖子需要注册账号后才能查看哦！");
            break;
		case 5:
			cm.dispose();
             //cm.openWeb("http://www.ddmxdsf.cn/forum.php?mod=viewthread&tid=26&extra=page%3D1");
            cm.sendOk("#e#r[提示]：\r\n已为您打开神秘徽章获取和升级说明~\r\n[注意]：\r\n部分帖子需要注册账号后才能查看哦！");
            break;			
		case 6:
			cm.dispose();
            cm.sendOk("#b\r\n打开万能NPC .一键潜能 .使用积分设置潜能即可利用PPMS微积分和PPMS活跃设置装备的一条潜能！ ");
            break;
            break;
		case 7:
            cm.dispose();
            //cm.openWeb("http://www.ddmxdsf.cn/forum.php?mod=viewthread&tid=30&extra=");
            cm.sendOk("#e#r[提示]：\r\n已为您打开免费强化指定装备教程~\r\n[注意]：\r\n部分帖子需要注册账号后才能查看哦！");
                break;
		case 8:
            cm.dispose();
            //cm.openWeb("http://www.ddmxdsf.cn/forum.php?mod=viewthread&tid=23&extra=page%3D1");
            cm.sendOk("#e#r[提示]：\r\n已为您打开免费获得会员和升级会员教程~\r\n[注意]：\r\n部分帖子需要注册账号后才能查看哦！");			
			break;
		case 9:
			cm.dispose();
            //cm.openWeb("http://www.ddmxdsf.cn/forum.php?mod=viewthread&tid=31&page=1&extra=#pid40");
            cm.sendOk("#e#r[提示]：\r\n已为您打开每日福利＆心悦特权说明教程~\r\n[注意]：\r\n部分帖子需要注册账号后才能查看哦！");	
			break;
		case 10:
            //cm.openWeb("http://www.ddmxdsf.cn/forum.php?mod=viewthread&tid=19&page=1&extra=#pid28");
            cm.sendOk("#e#r[提示]：\r\n已为您打开辅助轮系统使用说明\r\n[注意]：\r\n部分帖子需要注册账号后才能查看哦！");	
			break;
		case 11:
            //cm.openWeb("http://www.ddmxdsf.cn/forum.php?mod=viewthread&tid=27");
            cm.sendOk("#e#r[提示]：\r\n已为您打开本服特色红包系统使用说明\r\n[注意]：\r\n部分帖子需要注册账号后才能查看哦！");
			break;
		case 12:
			cm.dispose();
			cm.openNpc(2091111,"图腾合成");
			break;
		case 13:
            //cm.openWeb("http://www.ddmxdsf.cn/forum.php?mod=viewthread&tid=17&extra=page%3D1");
            cm.sendOk("#e#r本服非市面上的一条龙服务端.全新研发.全新模式.福利至上！和外面的妖娆贱货不一样哦~");
			break;
			break;

	}
    }
}
